{include file="public/header"}
<style>
	.f1{position: relative;}
	.sm-l .s1{width: 60px !important;}
	.yan_img{
		position: absolute;
		right: 15px;
		top: 6px;
		width: 90px;
		height: 35px;
	}
.bg_fixed{position: fixed;
	width: 100%;
	top: 0px;
	left: 0px;
	z-index: -1;
	background: url(__PUBLIC__/home/images/v8_1.png);
	background-size: 100% 100%;}
.index_section3 .center ul li .boss .a2 .p2 .s2{color:black;}
.index_section3 .center ul li .boss .a2 .p2 .s1{color:black;}
.logo_form .a2 .f2 .s1{color:#fff;}
.logo_form .a3 .z1{color:#000;}
.logo_form .a3 .z2{color:#000;}
</style>
<body class="in_body">

<!--    <div class="sectionY sectionY_tttt">-->
<!--        <a href="javascript:history.back();">-->
<!--            <img src="__PUBLIC__/images/right_x.png" alt="" class="a1">-->
<!--        </a>-->
<!--        <p class="p1" style="color: #fff">登录</p>-->
<!--    </div>-->
<style>
	.login_close{
		text-align: left;
		padding: 10px 15px;
	}
	.login_close img{
		width: 15px;
	}
</style>
	<div class="bg_fixed_v10_1"></div>
	<div class="logo">
		<div class="container">
			<img src="{:config("setting.web_name")}" alt="">
			<img src="{:config('setting.logo')}?_t={:time()}" alt="">
		</div>
	</div>
	<div class="logo_form">
			<div class="a1">
				<div class="f1 clearfix">
					<div class="sm-l">
<!--						<span class="s1">手机</span>-->
						<img src="__PUBLIC__/home/images/v10_a3.png" alt="" class="im1">
						<input type="text" name="selfphone" placeholder="请输入手机号" autocomplete="off">
					</div>
				</div>
				<div class="f1 clearfix">
					<div class="sm-l" style="margin-bottom: 5px">
<!--						<span class="s1">密码</span>-->
						<img src="__PUBLIC__/home/images/v10_a4.png" style="width: 16px" alt="" class="im1">
						<input type="password" name="passwd" placeholder="请输入密码">
						<img src="__PUBLIC__/home/images/v10_a5.png" alt="" class="im2 im2_1">
						<img src="__PUBLIC__/home/images/v10_a6.png" alt="" class="im2 im2_2">
					</div>
				</div>
				<!-- <div class="f1 clearfix">
					<div class="sm-l">
						<span class="s1">验证码</span>
						<input type="text" name="code" placeholder="验证码" autocomplete="off">
						<img src="{:captcha_src()}" alt="" class="yan_img" onclick="javascript:this.src='{:captcha_src()}'">
					</div>
				</div> -->
			</div>
			<div class="a2">
				<div class="f2">
					<input type="checkbox" checked="checked" id="check">
					<label for="check">
						<span class="s1">下次自动登录</span>
					</label>
				</div>
			</div>

			<div class="a4">
				<!--<input type="button" id="btnSubmit" value="登录">-->
				<div id="btnSubmit" style="cursor: pointer; margin: auto;border: 1px solid #29f5ff; background-color:#3398cf; width: 100%; height: 40px; line-height: 40px;border-radius: 5px; text-align: center; color: #fff;">登录</div>
			</div>
			<div class="a3 clearfix">
				<a href="{:url('Index/register')}" style="color: #fff" class="z1">免费注册</a>
				<a href="{:url('Index/forget')}" style="color: #fff" class="z2">忘记密码</a>
			</div>
	</div>
</body>
<script src="__PUBLIC__/home/js/jquery.cookie.js"></script>
<script>
	$(function(){
        /*初始化读取用户的用户名密码*/
		// var uname = $.cookie('username');
		var uname = localStorage.getItem('username');
        if(uname!=''){
            $("input[name='selfphone']").val(uname);
        }
		// var upwd = $.cookie('passwd');
		var upwd = localStorage.getItem('passwd');
        if(upwd!=''){
            $('input[name="passwd"]').val(upwd);
        }
	    $("#btnSubmit").click(function () {
            var data = {};
            data.selfphone = $.trim($("input[name='selfphone']").val());
            data.passwd = $.trim($("input[name='passwd']").val());
            // data.code = $.trim($("input[name='code']").val());
            if(data.selfphone == ""){
                layer.msg("手机号不能为空");
                return false;
            }
            if(data.passwd == ""){
                layer.msg("请输入密码");
                return false;
            }
            // if(data.code== ""){
            //     layer.msg("请输入验证码");
            //     return false;
            // }
            $.post("{:url('Index/login')}", data, function (res) {
                if(res.result_code == 0){
                    if($("#check").prop("checked")){
                        // $.cookie("username", data.selfphone);
                        // $.cookie("passwd", data.passwd);
						localStorage.setItem("username", data.selfphone);
						localStorage.setItem("passwd", data.passwd);
                    }
                    location.href = "{:url('Index/index')}"
                }else{
                    layer.msg(res.result_info);
                }
            });

        });
	})
</script>
<script>
	$(".im2_2").click(function () {
		$(this).hide().siblings(".im2_1").show().siblings("input").attr("type","text");
	})
	$(".im2_1").click(function () {
		$(this).hide().siblings(".im2_2").show().siblings("input").attr("type","password");
	})
</script>
</html>
